package info.yeohwah.ai.utils;

import cn.xsshome.taip.nlp.TAipNlp;
import cn.xsshome.taip.ptu.TAipPtu;
import cn.xsshome.taip.speech.TAipSpeech;

public class AIBeanFactory {
    private static String APP_ID = "";
    private static String APP_KEY = "";
    private static TAipPtu aipPtu;
    private static TAipSpeech aipSpeech ;
    private static  TAipNlp aipNlp;

    public static synchronized TAipPtu getTAipPtu() {
        if (aipPtu != null) {
            return aipPtu;
        }
        aipPtu = new TAipPtu(APP_ID, APP_KEY);
        return aipPtu;
    }

    public static synchronized TAipSpeech getAipSpeech(){
        if (aipSpeech != null) {
            return aipSpeech;
        }
        aipSpeech = new TAipSpeech(APP_ID, APP_KEY);
        return aipSpeech;
    }

    public static synchronized TAipNlp getTAipNlp(){
        if(aipNlp != null){
            return aipNlp;
        }
        aipNlp = new TAipNlp(APP_ID, APP_KEY);
        return aipNlp;
    }
}
